package com.yuke.cloud.service.tmc.service.impl;

import com.yuke.cloud.service.tmc.dao.TmcDeadLetterMsgMapper;
import com.yuke.cloud.service.tmc.entity.TmcDeadLetterMsg;
import com.yuke.cloud.service.tmc.service.TmcDeadLetterMsgService;
import com.yuke.cloud.common.core.support.BaseService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;


/**
 * Created by wg on 2018/09/08.
 */
@Service
@Transactional
public class TmcDeadLetterMsgServiceImpl extends BaseService<TmcDeadLetterMsg> implements TmcDeadLetterMsgService {
    @Resource
    private TmcDeadLetterMsgMapper tmcDeadLetterMsgMapper;

    //保存死信
    public int saveDeadMsg(TmcDeadLetterMsg tmcDeadLetterMsg) {

        int result = 0;

        if (null == tmcDeadLetterMsg.getDeadMsgId()) {  //新增
            Long id = super.generateId();
            tmcDeadLetterMsg.setDeadMsgId(id);

            result = this.save(tmcDeadLetterMsg);
        } else {
            //修改保存记录
        }

        return result;
    }
}
